<?php

namespace app\admin\model;

use think\Model;


class ClubDtl extends Model
{

    

    

    // 表名
    protected $name = 'club_dtl';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];


    public function club()
    {
        return $this->hasOne(Club::class, 'id', 'club_id', [], 'LEFT')->setEagerlyType(0);
    }

    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id', [], 'LEFT')->field('id,avatar,mobile,username,nickname');
    }

    public function clubs()
    {
        return $this->hasOne(Club::class, 'id', 'club_id')->field('id,name as club_name,img_url as club_img');
    }

    /**
     * 获取精品状态列表
     * @return array
     */
    public function getIsPremiumList()
    {
        return ['0' => __('否'), '1' => __('是')];
    }



}
